/**
 * @author        Nicolas Bottarini <nicolasbottarini@gmail.com>, 404 <http://www.proyecto404.com>
 * @version       $Rev: 3 $
 * @lastrevision  $Date: 2011-09-12 16:45:37 +0000 (Mon, 12 Sep 2011) $	 
 */
package com.proyecto404.core.collections {
	import com.proyecto404.core.BaseObject;
	
	public class Pair extends BaseObject {
		private var _first:*;
		private var _second:*;
		
		public function Pair(first:*, second:*) {
			_first = first;
			_second = second;
		}
		
		public function get first():* {
			return _first;
		}

		public function set first(value:*):void {
			_first = value;
		}

		public function get second():* {
			return _second;
		}

		public function set second(value:*):void {
			_second = value;
		}
		
		public function implode(separator:String = ","):String {
			return first + separator + second;
		}
		
		public override function toString():String {
			return "Pair{" + valueToString(first) + "," + valueToString(second) + "}";
		}
		
		public override function equals(value:*):Boolean {
			if (!(value is Pair)) { return false; }
			var pair:Pair = value as Pair;
			return areEquals(first, pair.first) && areEquals(second, pair.second);
		}
	}
}